Optimal. Leaf size=104 \[ \frac {(f+g x)^2 \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )}{2 g}-\frac {B (b f-a g)^2 \log (a+b x)}{b^2 g}-\frac {B g x (b c-a d)}{b d}+\frac {B (d f-c g)^2 \log (c+d x)}{d^2 g} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.09, antiderivative size = 104, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2525, 12, 72} \[ \frac {(f+g x)^2 \left (B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+A\right )}{2 g}-\frac {B (b f-a g)^2 \log (a+b x)}{b^2 g}-\frac {B g x (b c-a d)}{b d}+\frac {B (d f-c g)^2 \log (c+d x)}{d^2 g} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 72
Rule 2525
Rubi steps
\begin {align*} \int (f+g x) \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right ) \, dx &=\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{2 g}-\frac {B \int \frac {2 (b c-a d) (f+g x)^2}{(a+b x) (c+d x)} \, dx}{2 g}\\ &=\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{2 g}-\frac {(B (b c-a d)) \int \frac {(f+g x)^2}{(a+b x) (c+d x)} \, dx}{g}\\ &=\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{2 g}-\frac {(B (b c-a d)) \int \left (\frac {g^2}{b d}+\frac {(b f-a g)^2}{b (b c-a d) (a+b x)}+\frac {(d f-c g)^2}{d (-b c+a d) (c+d x)}\right ) \, dx}{g}\\ &=-\frac {B (b c-a d) g x}{b d}-\frac {B (b f-a g)^2 \log (a+b x)}{b^2 g}+\frac {(f+g x)^2 \left (A+B \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )\right )}{2 g}+\frac {B (d f-c g)^2 \log (c+d x)}{d^2 g}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.11, size = 118, normalized size = 1.13 \[ \frac {b \left (d \left (2 B g^2 x (a d-b c)+A b d (f+g x)^2\right )+b B d^2 (f+g x)^2 \log \left (\frac {e (a+b x)^2}{(c+d x)^2}\right )+2 b B (d f-c g)^2 \log (c+d x)\right )-2 B d^2 (b f-a g)^2 \log (a+b x)}{2 b^2 d^2 g} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.87, size = 174, normalized size = 1.67 \[ \frac {A b^{2} d^{2} g x^{2} + 2 \, {\left (A b^{2} d^{2} f - {\left (B b^{2} c d - B a b d^{2}\right )} g\right )} x + 2 \, {\left (2 \, B a b d^{2} f - B a^{2} d^{2} g\right )} \log \left (b x + a\right ) - 2 \, {\left (2 \, B b^{2} c d f - B b^{2} c^{2} g\right )} \log \left (d x + c\right ) + {\left (B b^{2} d^{2} g x^{2} + 2 \, B b^{2} d^{2} f x\right )} \log \left (\frac {b^{2} e x^{2} + 2 \, a b e x + a^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right )}{2 \, b^{2} d^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 1.11, size = 145, normalized size = 1.39 \[ \frac {1}{2} \, {\left (A g + B g\right )} x^{2} + \frac {1}{2} \, {\left (B g x^{2} + 2 \, B f x\right )} \log \left (\frac {b^{2} x^{2} + 2 \, a b x + a^{2}}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right ) + \frac {{\left (A b d f + B b d f - B b c g + B a d g\right )} x}{b d} + \frac {{\left (2 \, B a b f - B a^{2} g\right )} \log \left (b x + a\right )}{b^{2}} - \frac {{\left (2 \, B c d f - B c^{2} g\right )} \log \left (-d x - c\right )}{d^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.08, size = 656, normalized size = 6.31 \[ -\frac {2 B \,a^{2} c g \ln \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )}{\left (a d -b c \right ) b}+\frac {2 B \,a^{2} d f \ln \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )}{\left (a d -b c \right ) b}+\frac {4 B a \,c^{2} g \ln \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )}{\left (a d -b c \right ) d}-\frac {4 B a c f \ln \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )}{a d -b c}-\frac {2 B b \,c^{3} g \ln \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )}{\left (a d -b c \right ) d^{2}}+\frac {2 B b \,c^{2} f \ln \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )}{\left (a d -b c \right ) d}+\frac {B g \,x^{2} \ln \left (\frac {\left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )^{2} e}{d^{2}}\right )}{2}+\frac {A g \,x^{2}}{2}+B f x \ln \left (\frac {\left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )^{2} e}{d^{2}}\right )+A f x +\frac {B \,a^{2} g \ln \left (\frac {1}{d x +c}\right )}{b^{2}}-\frac {B \,a^{2} g \ln \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )}{b^{2}}+\frac {2 B a c g \ln \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )}{b d}-\frac {2 B a f \ln \left (\frac {1}{d x +c}\right )}{b}+\frac {B a g x}{b}-\frac {B \,c^{2} g \ln \left (\frac {1}{d x +c}\right )}{d^{2}}-\frac {B \,c^{2} g \ln \left (\frac {\left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )^{2} e}{d^{2}}\right )}{2 d^{2}}-\frac {B \,c^{2} g \ln \left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )}{d^{2}}+\frac {2 B c f \ln \left (\frac {1}{d x +c}\right )}{d}+\frac {B c f \ln \left (\frac {\left (\frac {a d}{d x +c}-\frac {b c}{d x +c}+b \right )^{2} e}{d^{2}}\right )}{d}-\frac {B c g x}{d}-\frac {A \,c^{2} g}{2 d^{2}}+\frac {A c f}{d}+\frac {B a c g}{b d}-\frac {B \,c^{2} g}{d^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.76, size = 246, normalized size = 2.37 \[ \frac {1}{2} \, A g x^{2} + {\left (x \log \left (\frac {b^{2} e x^{2}}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {2 \, a b e x}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {a^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right ) + \frac {2 \, a \log \left (b x + a\right )}{b} - \frac {2 \, c \log \left (d x + c\right )}{d}\right )} B f + \frac {1}{2} \, {\left (x^{2} \log \left (\frac {b^{2} e x^{2}}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {2 \, a b e x}{d^{2} x^{2} + 2 \, c d x + c^{2}} + \frac {a^{2} e}{d^{2} x^{2} + 2 \, c d x + c^{2}}\right ) - \frac {2 \, a^{2} \log \left (b x + a\right )}{b^{2}} + \frac {2 \, c^{2} \log \left (d x + c\right )}{d^{2}} - \frac {2 \, {\left (b c - a d\right )} x}{b d}\right )} B g + A f x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 4.50, size = 133, normalized size = 1.28 \[ \ln \left (\frac {e\,{\left (a+b\,x\right )}^2}{{\left (c+d\,x\right )}^2}\right )\,\left (\frac {B\,g\,x^2}{2}+B\,f\,x\right )+x\,\left (\frac {A\,a\,d\,g+A\,b\,c\,g+A\,b\,d\,f+B\,a\,d\,g-B\,b\,c\,g}{b\,d}-\frac {A\,g\,\left (a\,d+b\,c\right )}{b\,d}\right )+\frac {A\,g\,x^2}{2}-\frac {B\,a\,\ln \left (a+b\,x\right )\,\left (a\,g-2\,b\,f\right )}{b^2}+\frac {B\,c\,\ln \left (c+d\,x\right )\,\left (c\,g-2\,d\,f\right )}{d^2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 2.79, size = 314, normalized size = 3.02 \[ \frac {A g x^{2}}{2} - \frac {B a \left (a g - 2 b f\right ) \log {\left (x + \frac {B a^{2} c d g + \frac {B a^{2} d^{2} \left (a g - 2 b f\right )}{b} + B a b c^{2} g - 4 B a b c d f - B a c d \left (a g - 2 b f\right )}{B a^{2} d^{2} g - 2 B a b d^{2} f + B b^{2} c^{2} g - 2 B b^{2} c d f} \right )}}{b^{2}} + \frac {B c \left (c g - 2 d f\right ) \log {\left (x + \frac {B a^{2} c d g + B a b c^{2} g - 4 B a b c d f - B a b c \left (c g - 2 d f\right ) + \frac {B b^{2} c^{2} \left (c g - 2 d f\right )}{d}}{B a^{2} d^{2} g - 2 B a b d^{2} f + B b^{2} c^{2} g - 2 B b^{2} c d f} \right )}}{d^{2}} + x \left (A f + \frac {B a g}{b} - \frac {B c g}{d}\right ) + \left (B f x + \frac {B g x^{2}}{2}\right ) \log {\left (\frac {e \left (a + b x\right )^{2}}{\left (c + d x\right )^{2}} \right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________